/*
 * Copyright (c) 2006-2021, Ulandlink Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-12-06     zkw         first version
 */
#ifndef __APP_OCPP_SERVER_REQ_H__
#define __APP_OCPP_SERVER_REQ_H__

#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <rtthread.h>
#include "app_ocpp_util.h"

int ocpp_unpack_change_availability(char *payload);
int ocpp_pack_change_availability(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_change_configuration(char *payload);
int ocpp_pack_change_configuration(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_clear_cache(char *payload);
int ocpp_pack_clear_cache(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_get_configuration(char *payload);
int ocpp_pack_get_configuration(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_remote_start_transaction(char *payload);
int ocpp_pack_remote_start_transaction(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_remote_stop_transaction(char *payload);
int ocpp_pack_remote_stop_transaction(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_reset(char *payload);
int ocpp_pack_reset(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_unlock_connector(char *payload);
int ocpp_pack_unlock_connector(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_set_charging_profile(char *payload);
int ocpp_pack_set_charging_profile(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_clear_charging_profile(char *payload);
int ocpp_pack_clear_charging_profile(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_cancel_reservation(char *payload);
int ocpp_pack_cancel_reservation(char *payload, uint16_t payload_len, uint32_t resp_status);

#if defined(A5158_EDITION)
int ocpp_unpack_data_transfer_3rd_server(char *payload);
int ocpp_pack_data_transfer_3rd_server(char *payload, uint16_t payload_len, uint32_t resp_status);
#else
int ocpp_unpack_data_transfer_server(char *payload);
int ocpp_pack_data_transfer_server(char *payload, uint16_t payload_len, uint32_t resp_status);
#endif

int ocpp_unpack_get_composite_schedule(char *payload);
int ocpp_pack_get_composite_schedule(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_get_diagnostics(char *payload);
int ocpp_pack_get_diagnostics(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_get_localList_version(char *payload);
int ocpp_pack_get_localList_version(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_reserve_now(char *payload);
int ocpp_pack_reserve_now(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_send_LocalList(char *payload);
int ocpp_pack_send_LocalList(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_trigger_message(char *payload);
int ocpp_pack_trigger_message(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_update_firmware(char *payload);
int ocpp_pack_update_firmware(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_15118_cert_sign(char *payload);
int ocpp_pack_15118_cert_sign(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_15118_delete_cert(char *payload);
int ocpp_pack_15118_delete_cert(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_15118_get_inst_cert_ids(char *payload);
int ocpp_pack_15118_get_inst_cert_ids(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_15118_install_cert(char *payload);
int ocpp_pack_15118_install_cert(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_unpack_15118_ex_trigger_message(char *payload);
int ocpp_pack_15118_ex_trigger_message(char *payload, uint16_t payload_len, uint32_t resp_status);

int ocpp_pack_data_tran_get_message_id(char *payload, int *message_id);
#endif